//product
//productname
//category
//brand
//supplier
//apec1
//price
//discount
//num_in_stock
//num_sold

package mo.org.cm309.shoppingcart.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//import mo.org.cm309.shoppingcart.entity.User;
//import mo.org.cm309.shoppingcart.service.RoleService;
//import mo.org.cm309.shoppingcart.service.UserService;
//import mo.org.cm309.shoppingcart.utility.CommonUtility;

public class product_add extends HttpServlet {
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
Integer product= req.getParameter("product");
String productname= req.getParameter("productname");
String category= req.getParameter("category");
String brand= req.getParameter("brand");
String supplier= req.getParameter("supplier");
String apec1= req.getParameter("apec1");
Double price= req.getParameter("price");
Double discount= req.getParameter("discount");
Integer num_in_stock= req.getParameter("num_in_stock");
Integer num_sold= req.getParameter("num_sold");
		
		Product pproduct = new Product();
		user.setFirstname(firstName);
		user.setLastname(lastName);
		user.setEmail(eMail);
		user.setPassword(password);
		user.setPhoneNum(phoneNumber);
		user.setAddress(address);
		user.setCreditCard(creditCardNo);
		user.setCardExpiry(cardExpiry);
		user.setRoleId(RoleService.getrService().getIdByName(CommonUtility.ROLE_ADMIN_NAME));
		UserService uservice = new UserService(); 
		uservice.register(user);
	}
}
